﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.InteropServices;
using Mpfr.Structs;

namespace Mpfr
{
  public unsafe static class MpfrImport
  {
    private const string DLL_PATH = @"deps\nstl\bin\libmpfr-1.dll";
    public static unsafe void clear(mpfr_t dst)
    {
      clear(dst.mpfr_ptr);
    }
    public static unsafe int const_euler(mpfr_t dst, mpfr_rnd_t rnd)
    {
      return const_euler(dst.mpfr_ptr, (int)rnd);
    }
    public static unsafe int const_log2(mpfr_t dst, mpfr_rnd_t rnd)
    {
      return const_log2(dst.mpfr_ptr, (int)rnd);
    }
    public static unsafe int const_pi(mpfr_t dst, mpfr_rnd_t rnd)
    {
      return const_pi(dst.mpfr_ptr, (int)rnd);
    }
    public static unsafe int abs(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return abs(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int acos(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return acos(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int acosh(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return acosh(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int asin(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return asin(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int asinh(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return asinh(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int atan(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return atan(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int atanh(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return atanh(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int cos(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return cos(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int cosh(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return cosh(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int cot(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return cot(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int coth(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return coth(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int csc(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return csc(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int csch(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return csch(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe double get_d(mpfr_t op1, mpfr_rnd_t rnd)
    {
      return get_d(op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int add(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd)
    {
      return add(dst.mpfr_ptr, op1.mpfr_ptr, op2.mpfr_ptr, (int)rnd);
    }
    public static unsafe int mul(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd)
    {
      return mul(dst.mpfr_ptr, op1.mpfr_ptr, op2.mpfr_ptr, (int)rnd);
    }
    public static unsafe int sub(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd)
    {
      return sub(dst.mpfr_ptr, op1.mpfr_ptr, op2.mpfr_ptr, (int)rnd);
    }
    public static unsafe int add_d(mpfr_t dst, mpfr_t op1, double op2, mpfr_rnd_t rnd)
    {
      return add_d(dst.mpfr_ptr, op1.mpfr_ptr, op2, (int)rnd);
    }
    public static unsafe int add_si(mpfr_t dst, mpfr_t op1, int op2, mpfr_rnd_t rnd)
    {
      return add_si(dst.mpfr_ptr, op1.mpfr_ptr, op2, (int)rnd);
    }
    public static unsafe int add_ui(mpfr_t dst, mpfr_t op1, uint op2, mpfr_rnd_t rnd)
    {
      return add_ui(dst.mpfr_ptr, op1.mpfr_ptr, op2, (int)rnd);
    }
    public static unsafe int atan2(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd)
    {
      return atan2(dst.mpfr_ptr, op1.mpfr_ptr, op2.mpfr_ptr, (int)rnd);
    }
    public static unsafe int cmp(mpfr_t op1, mpfr_t op2)
    {
      return cmp(op1.mpfr_ptr, op2.mpfr_ptr);
    }
    public static unsafe int cmp_d(mpfr_t op1, double op2)
    {
      return cmp_d(op1.mpfr_ptr, op2);
    }
    public static unsafe int cmp_si(mpfr_t op1, int op2)
    {
      return cmp_si(op1.mpfr_ptr, op2);
    }
    public static unsafe int cmp_ui(mpfr_t op1, uint op2)
    {
      return cmp_ui(op1.mpfr_ptr, op2);
    }
    public static unsafe int cmpabs(mpfr_t op1, mpfr_t op2)
    {
      return cmpabs(op1.mpfr_ptr, op2.mpfr_ptr);
    }
    public static unsafe int d_div(mpfr_t dst, double a, mpfr_t op2, mpfr_rnd_t rnd)
    {
      return d_div(dst.mpfr_ptr, a, op2.mpfr_ptr, (int)rnd);
    }
    public static unsafe int si_div(mpfr_t dst, int a, mpfr_t op2, mpfr_rnd_t rnd)
    {
      return si_div(dst.mpfr_ptr, a, op2.mpfr_ptr, (int)rnd);
    }
    public static unsafe int d_sub(mpfr_t dst, double a, mpfr_t op2, mpfr_rnd_t rnd)
    {
      return d_sub(dst.mpfr_ptr, a, op2.mpfr_ptr, (int)rnd);
    }
    public static unsafe int si_sub(mpfr_t dst, int a, mpfr_t op2, mpfr_rnd_t rnd)
    {
      return si_sub(dst.mpfr_ptr, a, op2.mpfr_ptr, (int)rnd);
    }
    public static unsafe int div(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd)
    {
      return div(dst.mpfr_ptr, op1.mpfr_ptr, op2.mpfr_ptr, (int)rnd);
    }
    public static unsafe int div_d(mpfr_t dst, mpfr_t op1, double op2, mpfr_rnd_t rnd)
    {
      return div_d(dst.mpfr_ptr, op1.mpfr_ptr, op2, (int)rnd);
    }
    public static unsafe int get_si(mpfr_t dst, mpfr_rnd_t rnd)
    {
      return get_si(dst.mpfr_ptr, (int)rnd);
    }
    public static unsafe uint get_ui(mpfr_t dst, mpfr_rnd_t rnd)
    {
      return get_ui(dst.mpfr_ptr, (int)rnd);
    }
    public static unsafe int mul_d(mpfr_t dst, mpfr_t op1, double op2, mpfr_rnd_t rnd)
    {
      return mul_d(dst.mpfr_ptr, op1.mpfr_ptr, op2, (int)rnd);
    }
    public static unsafe int sub_d(mpfr_t dst, mpfr_t op1, double op2, mpfr_rnd_t rnd)
    {
      return sub_d(dst.mpfr_ptr, op1.mpfr_ptr, op2, (int)rnd);
    }
    public static unsafe int mul_si(mpfr_t dst, mpfr_t op1, int op2, mpfr_rnd_t rnd)
    {
      return mul_si(dst.mpfr_ptr, op1.mpfr_ptr, op2, (int)rnd);
    }
    public static unsafe int sub_si(mpfr_t dst, mpfr_t op1, int op2, mpfr_rnd_t rnd)
    {
      return sub_si(dst.mpfr_ptr, op1.mpfr_ptr, op2, (int)rnd);
    }
    public static unsafe int div_si(mpfr_t dst, mpfr_t op1, int op2, mpfr_rnd_t rnd)
    {
      return div_si(dst.mpfr_ptr, op1.mpfr_ptr, op2, (int)rnd);
    }
    public static unsafe int div_ui(mpfr_t dst, mpfr_t op1, uint op2, mpfr_rnd_t rnd)
    {
      return div_ui(dst.mpfr_ptr, op1.mpfr_ptr, op2, (int)rnd);
    }
    public static unsafe int neg(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return neg(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int exp(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return exp(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int exp10(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return exp10(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int exp2(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return exp2(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int fma(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_t op3, mpfr_rnd_t rnd)
    {
      return fma(dst.mpfr_ptr, op1.mpfr_ptr, op2.mpfr_ptr, op3.mpfr_ptr, (int)rnd);
    }
    public static unsafe int fms(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_t op3, mpfr_rnd_t rnd)
    {
      return fms(dst.mpfr_ptr, op1.mpfr_ptr, op2.mpfr_ptr, op3.mpfr_ptr, (int)rnd);
    }
    public static unsafe string get_version()
    {
      byte* cstr = mpfr_get_version();
      return Marshal.PtrToStringAnsi((IntPtr)cstr);
    }
    public static unsafe int hypot(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd)
    {
      return hypot(dst.mpfr_ptr, op1.mpfr_ptr, op2.mpfr_ptr, (int)rnd);
    }
    public static unsafe void init2(mpfr_t dst, uint prec)
    {
      init2(dst.mpfr_ptr, prec);
    }
    public static unsafe int init_set(mpfr_t dst, mpfr_t op, mpfr_rnd_t rnd)
    {
      init(dst.mpfr_ptr);
      return set(dst.mpfr_ptr, op.mpfr_ptr, (int)rnd);
    }
    public static unsafe int inf_p(mpfr_t dst)
    {
      return inf_p(dst.mpfr_ptr);
    }
    public static unsafe int log(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return log(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int log1p(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return log1p(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int log10(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return log10(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int log2(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return log2(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int mul_ui(mpfr_t dst, mpfr_t src, uint p, mpfr_rnd_t rnd)
    {
      return mul_ui(dst.mpfr_ptr, src.mpfr_ptr, p, (int)rnd);
    }
    public static unsafe int nan_p(mpfr_t op)
    {
      return nan_p(op.mpfr_ptr);
    }
    public static unsafe int number_p(mpfr_t op)
    {
      return number_p(op.mpfr_ptr);
    }
    public static unsafe int pow(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd)
    {
      return pow(dst.mpfr_ptr, op1.mpfr_ptr, op2.mpfr_ptr, (int)rnd);
    }
    public static unsafe int pow_si(mpfr_t dst, mpfr_t op1, int op2, mpfr_rnd_t rnd)
    {
      return pow_si(dst.mpfr_ptr, op1.mpfr_ptr, op2, (int)rnd);
    }
    public static unsafe int pow_ui(mpfr_t dst, mpfr_t op1, uint op2, mpfr_rnd_t rnd)
    {
      return pow_ui(dst.mpfr_ptr, op1.mpfr_ptr, op2, (int)rnd);
    }
    public static unsafe int sec(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return sec(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int sech(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return sech(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int set(mpfr_t dst, mpfr_t op, mpfr_rnd_t rnd)
    {
      return set(dst.mpfr_ptr, op.mpfr_ptr, (int)rnd);
    }
    public static unsafe int set_d(mpfr_t dst, double op, mpfr_rnd_t rnd)
    {
      return set_d(dst.mpfr_ptr, op, (int)rnd);
    }
    public static unsafe int set_si(mpfr_t dst, int op, mpfr_rnd_t rnd)
    {
      return set_si(dst.mpfr_ptr, op, (int)rnd);
    }
    public static unsafe int set_str(mpfr_t dst, string op, mpfr_rnd_t rnd)
    {
      byte* buffer = (byte*)Marshal.StringToHGlobalAnsi(op);

      return set_str(dst.mpfr_ptr, buffer, 10, (int)rnd);
    }
    public static unsafe int ui_pow(mpfr_t dst, uint op1, mpfr_t op2, mpfr_rnd_t rnd)
    {
      return ui_pow(dst.mpfr_ptr, op1, op2.mpfr_ptr, (int)rnd);
    }
    //public static unsafe int si_pow(mpfr_t dst, int op1, mpfr_t op2, mpfr_rnd_t rnd)
    //{
    //  return si_pow(dst.mpfr_ptr, op1, op2.mpfr_ptr, (int)rnd);
    //}
    public static unsafe void set_inf(mpfr_t dst, int sign)
    {
      set_inf(dst.mpfr_ptr, sign);
    }
    public static unsafe void set_nan(mpfr_t dst)
    {
      set_nan(dst.mpfr_ptr);
    }
    public static unsafe void set_str(mpfr_t dst, string value, int nbase, mpfr_rnd_t rnd)
    {
      byte* cstr = (byte*)Marshal.StringToHGlobalAnsi(value);

      set_str(dst.mpfr_ptr, cstr, nbase, (int)rnd);

      Marshal.FreeHGlobal((IntPtr)cstr);
    }
    public static unsafe int set_ui(mpfr_t dst, uint op, mpfr_rnd_t rnd)
    {
      return set_ui(dst.mpfr_ptr, op, (int)rnd);
    }
    public static unsafe string snprintf(string format, mpfr_t t)
    {
      int size = 65536;//1024;
      byte* buffer = (byte*)Marshal.AllocHGlobal(size);
      byte* pFormat = (byte*)Marshal.StringToHGlobalAnsi(format);

      int code = snprintf(buffer, size, pFormat, t.mpfr_ptr);

      string result = Marshal.PtrToStringAnsi((IntPtr)buffer);
      Marshal.FreeHGlobal((IntPtr)buffer);
      Marshal.FreeHGlobal((IntPtr)pFormat);

      return result;
    }

    public static unsafe string asprintf(string format, mpfr_t t)
    {
      byte* buffer = null;
      byte* cformat = (byte*)Marshal.StringToHGlobalAnsi(format);

      asprintf(&buffer, cformat, t.mpfr_ptr);

      string result = Marshal.PtrToStringAnsi((IntPtr)buffer);

      free_str(buffer);

      Marshal.FreeHGlobal((IntPtr)cformat);

      return result;
    }

    public static unsafe int sin(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return sin(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int sinh(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return sinh(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int sqr(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return sqr(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int sqrt(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return sqrt(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe void swap(mpfr_t dst, mpfr_t op1)
    {
      swap(dst.mpfr_ptr, op1.mpfr_ptr);
    }
    public static unsafe int tan(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return tan(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int tanh(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd)
    {
      return tanh(dst.mpfr_ptr, op1.mpfr_ptr, (int)rnd);
    }
    public static unsafe int zero_p(mpfr_t dst)
    {
      return zero_p(dst.mpfr_ptr);
    }
    public static unsafe void set_prec(mpfr_t dst, uint prec)
    {
      set_prec(dst.mpfr_ptr, prec);
    }
    public static unsafe uint get_prec(mpfr_t dst)
    {
      return get_prec(dst.mpfr_ptr);
    }
    public static unsafe int prec_round(mpfr_t dst, uint prec, mpfr_rnd_t rnd)
    {
      return prec_round(dst.mpfr_ptr, prec, (int)rnd);
    }
    public static unsafe int sin_cos(mpfr_t sop, mpfr_t cop, mpfr_t op, mpfr_rnd_t rnd)
    {
      return sin_cos(sop.mpfr_ptr, cop.mpfr_ptr, op.mpfr_ptr, (int)rnd);
    }

    #region mike generated
    /*
    public static unsafe int abs(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int acos(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int acosh(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int add(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int add_d(mpfr_t dst, mpfr_t op1, double op2, mpfr_rnd_t rnd);
    public static unsafe int add_q(mpfr_t dst, mpfr_t op1, mpq_t op2, mpfr_rnd_t rnd);
    public static unsafe int add_si(mpfr_t dst, mpfr_t op1, int op2, mpfr_rnd_t rnd);
    public static unsafe int add_ui(mpfr_t dst, mpfr_t op1, uint op2, mpfr_rnd_t rnd);
    public static unsafe int add_z(mpfr_t dst, mpfr_t op1, mpz_t op2, mpfr_rnd_t rnd);
    public static unsafe int agm(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int asin(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int asinh(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int atan(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int atan2(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int atanh(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int can_round(mpfr_t dst, int exp, mpfr_rnd_t rnd1, mpfr_rnd_t rnd2, uint prec);
    public static unsafe int cbrt(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int ceil(mpfr_t dst, mpfr_t op1);
    public static unsafe int check_range(mpfr_t dst, int op1, mpfr_rnd_t rnd);
    public static unsafe void clear(mpfr_t dst);
    public static void clear_erangeflag();
    public static void clear_flags();
    public static void clear_inexflag();
    public static void clear_nanflag();
    public static void clear_overflow();
    public static void clear_underflow();
    public static unsafe int cmp(mpfr_t dst, mpfr_t op1);
    public static unsafe int cmp3(mpfr_t dst, mpfr_t op1, int op2);
    public static unsafe int cmp_d(mpfr_t dst, double op1);
    public static unsafe int cmp_f(mpfr_t dst, mpf_t op1);
    public static unsafe int cmp_ld(mpfr_t dst, double op1);
    public static unsafe int cmp_q(mpfr_t dst, mpq_t op1);
    public static unsafe int cmp_si(mpfr_t dst, int op1);
    public static unsafe int cmp_si_2exp(mpfr_t dst, int op1, int exp);
    public static unsafe int cmp_ui(mpfr_t dst, uint op1);
    public static unsafe int cmp_ui_2exp(mpfr_t dst, uint op1, int exp);
    public static unsafe int cmp_z(mpfr_t dst, mpz_t op1);
    public static unsafe int cmpabs(mpfr_t dst, mpfr_t op1);
    public static unsafe int const_catalan(mpfr_t dst, mpfr_rnd_t rnd);
    public static unsafe int const_euler(mpfr_t dst, mpfr_rnd_t rnd);
    public static unsafe int const_log2(mpfr_t dst, mpfr_rnd_t rnd);
    public static unsafe int const_pi(mpfr_t dst, mpfr_rnd_t rnd);
    public static unsafe int copysign(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int cos(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int cosh(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int cot(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int coth(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int csc(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int csch(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int custom_get_exp(mpfr_t dst);
    public static unsafe int custom_get_kind(mpfr_t dst);
    public static unsafe void* custom_get_mantissa(mpfr_t dst);
    public static int custom_get_size(uint prec);
    public static unsafe void custom_init(void* op1, uint prec);
    public static unsafe void custom_init_set(mpfr_t dst, int op1, int exp, uint prec, void* op2);
    public static unsafe void custom_move(mpfr_t dst, void* op1);
    public static unsafe int d_div(mpfr_t dst, double op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int d_sub(mpfr_t dst, double op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int dim(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int div(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int div_2exp(mpfr_t dst, mpfr_t op1, uint op2, mpfr_rnd_t rnd);
    public static unsafe int div_2si(mpfr_t dst, mpfr_t op1, int op2, mpfr_rnd_t rnd);
    public static unsafe int div_2ui(mpfr_t dst, mpfr_t op1, uint op2, mpfr_rnd_t rnd);
    public static unsafe int div_d(mpfr_t dst, mpfr_t op1, double op2, mpfr_rnd_t rnd);
    public static unsafe int div_q(mpfr_t dst, mpfr_t op1, mpq_t op2, mpfr_rnd_t rnd);
    public static unsafe int div_si(mpfr_t dst, mpfr_t op1, int op2, mpfr_rnd_t rnd);
    public static unsafe int div_ui(mpfr_t dst, mpfr_t op1, uint op2, mpfr_rnd_t rnd);
    public static unsafe int div_z(mpfr_t dst, mpfr_t op1, mpz_t op2, mpfr_rnd_t rnd);
    public static unsafe void dump(mpfr_t dst);
    public static unsafe int eint(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int eq(mpfr_t dst, mpfr_t op1, uint op2);
    public static unsafe int equal_p(mpfr_t dst, mpfr_t op1);
    public static int erangeflag_p();
    public static unsafe int erf(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int erfc(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int exp(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int exp10(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int exp2(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int expm1(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe void extract(mpz_t dst, mpfr_t op1, uint op2);
    public static unsafe int fac_ui(mpfr_t dst, uint op1, mpfr_rnd_t rnd);
    public static unsafe int fits_intmax_p(mpfr_t dst, mpfr_rnd_t rnd);
    public static unsafe int fits_sint_p(mpfr_t dst, mpfr_rnd_t rnd);
    public static unsafe int fits_slong_p(mpfr_t dst, mpfr_rnd_t rnd);
    public static unsafe int fits_sshort_p(mpfr_t dst, mpfr_rnd_t rnd);
    public static unsafe int fits_uint_p(mpfr_t dst, mpfr_rnd_t rnd);
    public static unsafe int fits_uintmax_p(mpfr_t dst, mpfr_rnd_t rnd);
    public static unsafe int fits_ulong_p(mpfr_t dst, mpfr_rnd_t rnd);
    public static unsafe int fits_ushort_p(mpfr_t dst, mpfr_rnd_t rnd);
    public static unsafe int floor(mpfr_t dst, mpfr_t op1);
    public static unsafe int fma(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_t op3, mpfr_rnd_t rnd);
    public static unsafe int fmod(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int fms(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_t op3, mpfr_rnd_t rnd);
    public static unsafe int frac(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static void free_cache();
    public static unsafe void free_str(byte* cstr);
    public static unsafe int gamma(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe double get_d(mpfr_t dst, mpfr_rnd_t rnd);
    public static unsafe double get_d1(mpfr_t dst);
    public static unsafe double get_d_2exp(int* op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static uint get_default_prec();
    public static int get_default_rounding_mode();
    public static int get_emax();
    public static int get_emax_max();
    public static int get_emax_min();
    public static int get_emin();
    public static int get_emin_max();
    public static int get_emin_min();
    public static unsafe int get_exp(mpfr_t dst);
    public static unsafe int get_f(mpf_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe double get_ld(mpfr_t dst, mpfr_rnd_t rnd);
    public static unsafe double get_ld_2exp(int* op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe byte* mpfr_get_patches();
    public static unsafe uint get_prec(mpfr_t dst);
    public static unsafe int get_si(mpfr_t dst, mpfr_rnd_t rnd);
    public static unsafe byte* get_str(byte* cstr, int* exp, int op1, int len, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe uint get_ui(mpfr_t dst, mpfr_rnd_t rnd);
    public static unsafe byte* mpfr_get_version();
    public static unsafe void get_z(mpz_t z, mpfr_t f, mpfr_rnd_t rnd);
    public static unsafe int get_z_exp(mpz_t dst, mpfr_t op1);
    public static unsafe int greater_p(mpfr_t dst, mpfr_t op1);
    public static unsafe int greaterequal_p(mpfr_t dst, mpfr_t op1);
    public static unsafe int hypot(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static int inexflag_p();
    public static unsafe int inf_p(mpfr_t dst);
    public static unsafe void init(mpfr_t dst);
    public static unsafe void init2(mpfr_t dst, uint prec);
    public static unsafe int init_set_str(mpfr_t dst, byte* cstr, int op1, mpfr_rnd_t rnd);
    public static unsafe int integer_p(mpfr_t dst);
    public static unsafe int j0(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int j1(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int jn(mpfr_t dst, int op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int less_p(mpfr_t dst, mpfr_t op1);
    public static unsafe int lessequal_p(mpfr_t dst, mpfr_t op1);
    public static unsafe int lessgreater_p(mpfr_t dst, mpfr_t op1);
    public static unsafe int lgamma(mpfr_t dst, int* op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int li2(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int lngamma(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int log(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int log10(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int log1p(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int log2(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int max(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int min(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int modf(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int mul(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int mul_2exp(mpfr_t dst, mpfr_t op1, uint op2, mpfr_rnd_t rnd);
    public static unsafe int mul_2si(mpfr_t dst, mpfr_t op1, int op2, mpfr_rnd_t rnd);
    public static unsafe int mul_2ui(mpfr_t dst, mpfr_t op1, uint op2, mpfr_rnd_t rnd);
    public static unsafe int mul_d(mpfr_t dst, mpfr_t op1, double op2, mpfr_rnd_t rnd);
    public static unsafe int mul_q(mpfr_t dst, mpfr_t op1, mpq_t op2, mpfr_rnd_t rnd);
    public static unsafe int mul_si(mpfr_t dst, mpfr_t op1, int op2, mpfr_rnd_t rnd);
    public static unsafe int mul_ui(mpfr_t dst, mpfr_t op1, uint op2, mpfr_rnd_t rnd);
    public static unsafe int mul_z(mpfr_t dst, mpfr_t op1, mpz_t op2, mpfr_rnd_t rnd);
    public static unsafe int nan_p(mpfr_t dst);
    public static int nanflag_p();
    public static unsafe int neg(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe void nextabove(mpfr_t dst);
    public static unsafe void nextbelow(mpfr_t dst);
    public static unsafe void nexttoward(mpfr_t dst, mpfr_t op1);
    public static unsafe int number_p(mpfr_t dst);
    public static int overflow_p();
    public static unsafe int pow(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int pow_si(mpfr_t dst, mpfr_t op1, int op2, mpfr_rnd_t rnd);
    public static unsafe int pow_ui(mpfr_t dst, mpfr_t op1, uint op2, mpfr_rnd_t rnd);
    public static unsafe int pow_z(mpfr_t dst, mpfr_t op1, mpz_t op2, mpfr_rnd_t rnd);
    public static unsafe int prec_round(mpfr_t dst, uint prec, mpfr_rnd_t rnd);
    public static unsafe byte* print_rnd_mode(mpfr_rnd_t rnd);
    public static unsafe void random(mpfr_t dst);
    public static unsafe void random2(mpfr_t dst, int size, int exp);
    public static unsafe int rec_sqrt(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe void reldiff(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int remainder(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int remquo(mpfr_t dst, int* op1, mpfr_t op2, mpfr_t op3, mpfr_rnd_t rnd);
    public static unsafe int rint(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int rint_ceil(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int rint_floor(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int rint_round(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int rint_trunc(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int root(mpfr_t dst, mpfr_t op1, uint op2, mpfr_rnd_t rnd);
    public static unsafe int round(mpfr_t dst, mpfr_t op1);
    public static unsafe int sec(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int sech(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int set(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int set4(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd, int op2);
    public static unsafe int set_d(mpfr_t dst, double op1, mpfr_rnd_t rnd);
    public static void set_default_prec(uint prec);
    public static void set_default_rounding_mode(mpfr_rnd_t rnd);
    public static int set_emax(int exp);
    public static int set_emin(int exp);
    public static void set_erangeflag();
    public static unsafe int set_exp(mpfr_t dst, int exp);
    public static unsafe int set_f(mpfr_t dst, mpf_t op1, mpfr_rnd_t rnd);
    public static void set_inexflag();
    public static unsafe void set_inf(mpfr_t dst, int op1);
    public static unsafe int set_ld(mpfr_t dst, double op1, mpfr_rnd_t rnd);
    public static unsafe void set_nan(mpfr_t dst);
    public static void set_nanflag();
    public static void set_overflow();
    public static unsafe void set_prec(mpfr_t dst, uint prec);
    public static unsafe void set_prec_raw(mpfr_t dst, uint prec);
    public static unsafe int set_q(mpfr_t dst, mpq_t op1, mpfr_rnd_t rnd);
    public static unsafe int set_si(mpfr_t dst, int op1, mpfr_rnd_t rnd);
    public static unsafe int set_si_2exp(mpfr_t dst, int op1, int exp, mpfr_rnd_t rnd);
    public static unsafe int set_str(mpfr_t dst, byte* cstr, int op1, mpfr_rnd_t rnd);
    public static unsafe int set_ui(mpfr_t dst, uint op1, mpfr_rnd_t rnd);
    public static unsafe int set_ui_2exp(mpfr_t dst, uint op1, int exp, mpfr_rnd_t rnd);
    public static void set_underflow();
    public static unsafe int set_z(mpfr_t dst, mpz_t op1, mpfr_rnd_t rnd);
    public static unsafe int setsign(mpfr_t dst, mpfr_t op1, int op2, mpfr_rnd_t rnd);
    public static unsafe int sgn(mpfr_t dst);
    public static unsafe int si_div(mpfr_t dst, int op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int si_sub(mpfr_t dst, int op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int signbit(mpfr_t dst);
    public static unsafe int sin(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int sin_cos(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int sinh(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int sinh_cosh(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int snprintf(byte* cstr1, int len, byte* cstr2, mpfr_t t);
    public static unsafe int sqr(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int sqrt(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int sqrt_ui(mpfr_t dst, uint op1, mpfr_rnd_t rnd);
    public static unsafe int strtofr(mpfr_t dst, byte* cstr1, byte** pcstr2, int op1, mpfr_rnd_t rnd);
    public static unsafe int sub(mpfr_t dst, mpfr_t op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int sub_d(mpfr_t dst, mpfr_t op1, double op2, mpfr_rnd_t rnd);
    public static unsafe int sub_q(mpfr_t dst, mpfr_t op1, mpq_t op2, mpfr_rnd_t rnd);
    public static unsafe int sub_si(mpfr_t dst, mpfr_t op1, int op2, mpfr_rnd_t rnd);
    public static unsafe int sub_ui(mpfr_t dst, mpfr_t op1, uint op2, mpfr_rnd_t rnd);
    public static unsafe int sub_z(mpfr_t dst, mpfr_t op1, mpz_t op2, mpfr_rnd_t rnd);
    public static unsafe int subnormalize(mpfr_t dst, int op1, mpfr_rnd_t rnd);
    public static unsafe int sum(mpfr_t dst, mpfr_t* op1, uint op2, mpfr_rnd_t rnd);
    public static unsafe void swap(mpfr_t dst, mpfr_t op1);
    public static unsafe int ui_div(mpfr_t dst, uint op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int ui_pow(mpfr_t dst, uint op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int ui_pow_ui(mpfr_t dst, uint op1, uint op2, mpfr_rnd_t rnd);
    public static unsafe int ui_sub(mpfr_t dst, uint op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static int underflow_p();
    public static unsafe int unordered_p(mpfr_t dst, mpfr_t op1);
    public static unsafe int urandomb(mpfr_t dst, gmp_randstate_t op1);
    public static unsafe int y0(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int y1(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int yn(mpfr_t dst, int op1, mpfr_t op2, mpfr_rnd_t rnd);
    public static unsafe int zero_p(mpfr_t dst);
    public static unsafe int zeta(mpfr_t dst, mpfr_t op1, mpfr_rnd_t rnd);
    public static unsafe int zeta_ui(mpfr_t dst, uint op1, mpfr_rnd_t rnd);    
    */
    #endregion

    #region auto generated
    [DllImport(DLL_PATH, EntryPoint = "mpfr_abs")]
    private static extern unsafe int abs(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_acos")]
    private static extern unsafe int acos(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_acosh")]
    private static extern unsafe int acosh(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_add")]
    private static extern unsafe int add(__mpfr_struct* dst, __mpfr_struct* op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_add_d")]
    private static extern unsafe int add_d(__mpfr_struct* dst, __mpfr_struct* op1, double op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_add_q")]
    private static extern unsafe int add_q(__mpfr_struct* dst, __mpfr_struct* op1, __mpq_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_add_si")]
    private static extern unsafe int add_si(__mpfr_struct* dst, __mpfr_struct* op1, int op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_add_ui")]
    private static extern unsafe int add_ui(__mpfr_struct* dst, __mpfr_struct* op1, uint op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_add_z")]
    private static extern unsafe int add_z(__mpfr_struct* dst, __mpfr_struct* op1, __mpz_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_agm")]
    private static extern unsafe int agm(__mpfr_struct* dst, __mpfr_struct* op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_asin")]
    private static extern unsafe int asin(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_asinh")]
    private static extern unsafe int asinh(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_asprintf")]
    private static extern unsafe int asprintf(byte** pcstr1, byte* cstr2, __mpfr_struct* op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_atan")]
    private static extern unsafe int atan(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_atan2")]
    private static extern unsafe int atan2(__mpfr_struct* dst, __mpfr_struct* op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_atanh")]
    private static extern unsafe int atanh(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_can_round")]
    private static extern unsafe int can_round(__mpfr_struct* dst, int exp, int rnd1, int rnd2, uint prec);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_cbrt")]
    private static extern unsafe int cbrt(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_ceil")]
    private static extern unsafe int ceil(__mpfr_struct* dst, __mpfr_struct* op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_check_range")]
    private static extern unsafe int check_range(__mpfr_struct* dst, int op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_clear")]
    private static extern unsafe void clear(__mpfr_struct* dst);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_clear_erangeflag")]
    public static extern void clear_erangeflag();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_clear_flags")]
    public static extern void clear_flags();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_clear_inexflag")]
    public static extern void clear_inexflag();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_clear_nanflag")]
    public static extern void clear_nanflag();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_clear_overflow")]
    public static extern void clear_overflow();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_clear_underflow")]
    public static extern void clear_underflow();
    //[DllImport(DLL_PATH, EntryPoint = "mpfr_clears")]
    //private static extern unsafe void clears(__mpfr_struct* dst, ...);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_cmp")]
    private static extern unsafe int cmp(__mpfr_struct* dst, __mpfr_struct* op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_cmp3")]
    private static extern unsafe int cmp3(__mpfr_struct* dst, __mpfr_struct* op1, int op2);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_cmp_d")]
    private static extern unsafe int cmp_d(__mpfr_struct* dst, double op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_cmp_f")]
    private static extern unsafe int cmp_f(__mpfr_struct* dst, __mpf_struct* op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_cmp_ld")]
    private static extern unsafe int cmp_ld(__mpfr_struct* dst, double op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_cmp_q")]
    private static extern unsafe int cmp_q(__mpfr_struct* dst, __mpq_struct* op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_cmp_si")]
    private static extern unsafe int cmp_si(__mpfr_struct* dst, int op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_cmp_si_2exp")]
    private static extern unsafe int cmp_si_2exp(__mpfr_struct* dst, int op1, int exp);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_cmp_ui")]
    private static extern unsafe int cmp_ui(__mpfr_struct* dst, uint op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_cmp_ui_2exp")]
    private static extern unsafe int cmp_ui_2exp(__mpfr_struct* dst, uint op1, int exp);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_cmp_z")]
    private static extern unsafe int cmp_z(__mpfr_struct* dst, __mpz_struct* op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_cmpabs")]
    private static extern unsafe int cmpabs(__mpfr_struct* dst, __mpfr_struct* op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_const_catalan")]
    private static extern unsafe int const_catalan(__mpfr_struct* dst, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_const_euler")]
    private static extern unsafe int const_euler(__mpfr_struct* dst, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_const_log2")]
    private static extern unsafe int const_log2(__mpfr_struct* dst, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_const_pi")]
    private static extern unsafe int const_pi(__mpfr_struct* dst, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_copysign")]
    private static extern unsafe int copysign(__mpfr_struct* dst, __mpfr_struct* op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_cos")]
    private static extern unsafe int cos(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_cosh")]
    private static extern unsafe int cosh(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_cot")]
    private static extern unsafe int cot(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_coth")]
    private static extern unsafe int coth(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_csc")]
    private static extern unsafe int csc(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_csch")]
    private static extern unsafe int csch(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_custom_get_exp")]
    private static extern unsafe int custom_get_exp(__mpfr_struct* dst);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_custom_get_kind")]
    private static extern unsafe int custom_get_kind(__mpfr_struct* dst);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_custom_get_mantissa")]
    private static extern unsafe void* custom_get_mantissa(__mpfr_struct* dst);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_custom_get_size")]
    public static extern int custom_get_size(uint prec);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_custom_init")]
    private static extern unsafe void custom_init(void* op1, uint prec);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_custom_init_set")]
    private static extern unsafe void custom_init_set(__mpfr_struct* dst, int op1, int exp, uint prec, void* op2);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_custom_move")]
    private static extern unsafe void custom_move(__mpfr_struct* dst, void* op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_d_div")]
    private static extern unsafe int d_div(__mpfr_struct* dst, double op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_d_sub")]
    private static extern unsafe int d_sub(__mpfr_struct* dst, double op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_dim")]
    private static extern unsafe int dim(__mpfr_struct* dst, __mpfr_struct* op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_div")]
    private static extern unsafe int div(__mpfr_struct* dst, __mpfr_struct* op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_div_2exp")]
    private static extern unsafe int div_2exp(__mpfr_struct* dst, __mpfr_struct* op1, uint op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_div_2si")]
    private static extern unsafe int div_2si(__mpfr_struct* dst, __mpfr_struct* op1, int op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_div_2ui")]
    private static extern unsafe int div_2ui(__mpfr_struct* dst, __mpfr_struct* op1, uint op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_div_d")]
    private static extern unsafe int div_d(__mpfr_struct* dst, __mpfr_struct* op1, double op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_div_q")]
    private static extern unsafe int div_q(__mpfr_struct* dst, __mpfr_struct* op1, __mpq_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_div_si")]
    private static extern unsafe int div_si(__mpfr_struct* dst, __mpfr_struct* op1, int op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_div_ui")]
    private static extern unsafe int div_ui(__mpfr_struct* dst, __mpfr_struct* op1, uint op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_div_z")]
    private static extern unsafe int div_z(__mpfr_struct* dst, __mpfr_struct* op1, __mpz_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_dump")]
    private static extern unsafe void dump(__mpfr_struct* dst);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_eint")]
    private static extern unsafe int eint(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_eq")]
    private static extern unsafe int eq(__mpfr_struct* dst, __mpfr_struct* op1, uint op2);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_equal_p")]
    private static extern unsafe int equal_p(__mpfr_struct* dst, __mpfr_struct* op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_erangeflag_p")]
    public static extern int erangeflag_p();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_erf")]
    private static extern unsafe int erf(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_erfc")]
    private static extern unsafe int erfc(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_exp")]
    private static extern unsafe int exp(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_exp10")]
    private static extern unsafe int exp10(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_exp2")]
    private static extern unsafe int exp2(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_expm1")]
    private static extern unsafe int expm1(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_extract")]
    private static extern unsafe void extract(__mpz_struct* dst, __mpfr_struct* op1, uint op2);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_fac_ui")]
    private static extern unsafe int fac_ui(__mpfr_struct* dst, uint op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_fits_intmax_p")]
    private static extern unsafe int fits_intmax_p(__mpfr_struct* dst, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_fits_sint_p")]
    private static extern unsafe int fits_sint_p(__mpfr_struct* dst, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_fits_slong_p")]
    private static extern unsafe int fits_slong_p(__mpfr_struct* dst, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_fits_sshort_p")]
    private static extern unsafe int fits_sshort_p(__mpfr_struct* dst, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_fits_uint_p")]
    private static extern unsafe int fits_uint_p(__mpfr_struct* dst, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_fits_uintmax_p")]
    private static extern unsafe int fits_uintmax_p(__mpfr_struct* dst, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_fits_ulong_p")]
    private static extern unsafe int fits_ulong_p(__mpfr_struct* dst, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_fits_ushort_p")]
    private static extern unsafe int fits_ushort_p(__mpfr_struct* dst, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_floor")]
    private static extern unsafe int floor(__mpfr_struct* dst, __mpfr_struct* op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_fma")]
    private static extern unsafe int fma(__mpfr_struct* dst, __mpfr_struct* op1, __mpfr_struct* op2, __mpfr_struct* op3, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_fmod")]
    private static extern unsafe int fmod(__mpfr_struct* dst, __mpfr_struct* op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_fms")]
    private static extern unsafe int fms(__mpfr_struct* dst, __mpfr_struct* op1, __mpfr_struct* op2, __mpfr_struct* op3, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_frac")]
    private static extern unsafe int frac(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_free_cache")]
    public static extern void free_cache();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_free_str")]
    private static extern unsafe void free_str(byte* cstr);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_gamma")]
    private static extern unsafe int gamma(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_d")]
    private static extern unsafe double get_d(__mpfr_struct* dst, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_d1")]
    private static extern unsafe double get_d1(__mpfr_struct* dst);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_d_2exp")]
    private static extern unsafe double get_d_2exp(int* op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_default_prec")]
    public static extern uint get_default_prec();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_default_rounding_mode")]
    public static extern int get_default_rounding_mode();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_emax")]
    public static extern int get_emax();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_emax_max")]
    public static extern int get_emax_max();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_emax_min")]
    public static extern int get_emax_min();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_emin")]
    public static extern int get_emin();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_emin_max")]
    public static extern int get_emin_max();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_emin_min")]
    public static extern int get_emin_min();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_exp")]
    private static extern unsafe int get_exp(__mpfr_struct* dst);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_f")]
    private static extern unsafe int get_f(__mpf_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_ld")]
    private static extern unsafe double get_ld(__mpfr_struct* dst, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_ld_2exp")]
    private static extern unsafe double get_ld_2exp(int* op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_patches")]
    private static extern unsafe byte* mpfr_get_patches();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_prec")]
    private static extern unsafe uint get_prec(__mpfr_struct* dst);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_si")]
    private static extern unsafe int get_si(__mpfr_struct* dst, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_str")]
    private static extern unsafe byte* get_str(byte* cstr, int* exp, int op1, int len, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_ui")]
    private static extern unsafe uint get_ui(__mpfr_struct* dst, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_version")]
    private static extern unsafe byte* mpfr_get_version();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_z")]
    private static extern unsafe void get_z(__mpz_struct* z, __mpfr_struct* f, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_get_z_exp")]
    private static extern unsafe int get_z_exp(__mpz_struct* dst, __mpfr_struct* op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_greater_p")]
    private static extern unsafe int greater_p(__mpfr_struct* dst, __mpfr_struct* op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_greaterequal_p")]
    private static extern unsafe int greaterequal_p(__mpfr_struct* dst, __mpfr_struct* op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_hypot")]
    private static extern unsafe int hypot(__mpfr_struct* dst, __mpfr_struct* op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_inexflag_p")]
    public static extern int inexflag_p();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_inf_p")]
    private static extern unsafe int inf_p(__mpfr_struct* dst);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_init")]
    private static extern unsafe void init(__mpfr_struct* dst);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_init2", CallingConvention = CallingConvention.StdCall)]
    private static extern unsafe void init2(__mpfr_struct* dst, uint prec);
    //boo hoo! no macros!
    //[DllImport(DLL_PATH, EntryPoint = "mpfr_init_set")]
    //private static extern unsafe int init_set(__mpfr_struct* dst, __mpfr_struct* op, int rnd);    
    [DllImport(DLL_PATH, EntryPoint = "mpfr_init_set_str")]
    private static extern unsafe int init_set_str(__mpfr_struct* dst, byte* cstr, int op1, int rnd);
    //[DllImport(DLL_PATH, EntryPoint = "mpfr_inits")]
    //private static extern unsafe void inits(__mpfr_struct* dst, ...);
    //[DllImport(DLL_PATH, EntryPoint = "mpfr_inits2")]
    //private static extern unsafe void inits2(uint prec, __mpfr_struct* op1, ...);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_integer_p")]
    private static extern unsafe int integer_p(__mpfr_struct* dst);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_j0")]
    private static extern unsafe int j0(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_j1")]
    private static extern unsafe int j1(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_jn")]
    private static extern unsafe int jn(__mpfr_struct* dst, int op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_less_p")]
    private static extern unsafe int less_p(__mpfr_struct* dst, __mpfr_struct* op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_lessequal_p")]
    private static extern unsafe int lessequal_p(__mpfr_struct* dst, __mpfr_struct* op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_lessgreater_p")]
    private static extern unsafe int lessgreater_p(__mpfr_struct* dst, __mpfr_struct* op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_lgamma")]
    private static extern unsafe int lgamma(__mpfr_struct* dst, int* op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_li2")]
    private static extern unsafe int li2(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_lngamma")]
    private static extern unsafe int lngamma(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_log")]
    private static extern unsafe int log(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_log10")]
    private static extern unsafe int log10(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_log1p")]
    private static extern unsafe int log1p(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_log2")]
    private static extern unsafe int log2(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_max")]
    private static extern unsafe int max(__mpfr_struct* dst, __mpfr_struct* op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_min")]
    private static extern unsafe int min(__mpfr_struct* dst, __mpfr_struct* op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_modf")]
    private static extern unsafe int modf(__mpfr_struct* dst, __mpfr_struct* op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_mul")]
    private static extern unsafe int mul(__mpfr_struct* dst, __mpfr_struct* op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_mul_2exp")]
    private static extern unsafe int mul_2exp(__mpfr_struct* dst, __mpfr_struct* op1, uint op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_mul_2si")]
    private static extern unsafe int mul_2si(__mpfr_struct* dst, __mpfr_struct* op1, int op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_mul_2ui")]
    private static extern unsafe int mul_2ui(__mpfr_struct* dst, __mpfr_struct* op1, uint op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_mul_d")]
    private static extern unsafe int mul_d(__mpfr_struct* dst, __mpfr_struct* op1, double op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_mul_q")]
    private static extern unsafe int mul_q(__mpfr_struct* dst, __mpfr_struct* op1, __mpq_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_mul_si")]
    private static extern unsafe int mul_si(__mpfr_struct* dst, __mpfr_struct* op1, int op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_mul_ui")]
    private static extern unsafe int mul_ui(__mpfr_struct* dst, __mpfr_struct* op1, uint op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_mul_z")]
    private static extern unsafe int mul_z(__mpfr_struct* dst, __mpfr_struct* op1, __mpz_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_nan_p")]
    private static extern unsafe int nan_p(__mpfr_struct* dst);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_nanflag_p")]
    public static extern int nanflag_p();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_neg")]
    private static extern unsafe int neg(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_nextabove")]
    private static extern unsafe void nextabove(__mpfr_struct* dst);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_nextbelow")]
    private static extern unsafe void nextbelow(__mpfr_struct* dst);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_nexttoward")]
    private static extern unsafe void nexttoward(__mpfr_struct* dst, __mpfr_struct* op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_number_p")]
    private static extern unsafe int number_p(__mpfr_struct* dst);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_overflow_p")]
    public static extern int overflow_p();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_pow")]
    private static extern unsafe int pow(__mpfr_struct* dst, __mpfr_struct* op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_pow_si")]
    private static extern unsafe int pow_si(__mpfr_struct* dst, __mpfr_struct* op1, int op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_pow_ui")]
    private static extern unsafe int pow_ui(__mpfr_struct* dst, __mpfr_struct* op1, uint op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_pow_z")]
    private static extern unsafe int pow_z(__mpfr_struct* dst, __mpfr_struct* op1, __mpz_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_prec_round")]
    private static extern unsafe int prec_round(__mpfr_struct* dst, uint prec, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_print_rnd_mode")]
    private static extern unsafe byte* print_rnd_mode(int rnd);
    //[DllImport(DLL_PATH, EntryPoint = "mpfr_printf")]
    //private static extern unsafe int printf( byte* cstr, ...);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_random")]
    private static extern unsafe void random(__mpfr_struct* dst);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_random2")]
    private static extern unsafe void random2(__mpfr_struct* dst, int size, int exp);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_rec_sqrt")]
    private static extern unsafe int rec_sqrt(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_reldiff")]
    private static extern unsafe void reldiff(__mpfr_struct* dst, __mpfr_struct* op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_remainder")]
    private static extern unsafe int remainder(__mpfr_struct* dst, __mpfr_struct* op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_remquo")]
    private static extern unsafe int remquo(__mpfr_struct* dst, int* op1, __mpfr_struct* op2, __mpfr_struct* op3, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_rint")]
    private static extern unsafe int rint(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_rint_ceil")]
    private static extern unsafe int rint_ceil(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_rint_floor")]
    private static extern unsafe int rint_floor(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_rint_round")]
    private static extern unsafe int rint_round(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_rint_trunc")]
    private static extern unsafe int rint_trunc(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_root")]
    private static extern unsafe int root(__mpfr_struct* dst, __mpfr_struct* op1, uint op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_round")]
    private static extern unsafe int round(__mpfr_struct* dst, __mpfr_struct* op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_sec")]
    private static extern unsafe int sec(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_sech")]
    private static extern unsafe int sech(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set")]
    private static extern unsafe int set(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set4")]
    private static extern unsafe int set4(__mpfr_struct* dst, __mpfr_struct* op1, int rnd, int op2);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_d")]
    private static extern unsafe int set_d(__mpfr_struct* dst, double op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_default_prec")]
    public static extern void set_default_prec(uint prec);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_default_rounding_mode")]
    public static extern void set_default_rounding_mode(int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_emax")]
    public static extern int set_emax(int exp);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_emin")]
    public static extern int set_emin(int exp);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_erangeflag")]
    public static extern void set_erangeflag();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_exp")]
    private static extern unsafe int set_exp(__mpfr_struct* dst, int exp);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_f")]
    private static extern unsafe int set_f(__mpfr_struct* dst, __mpf_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_inexflag")]
    public static extern void set_inexflag();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_inf")]
    private static extern unsafe void set_inf(__mpfr_struct* dst, int op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_ld")]
    private static extern unsafe int set_ld(__mpfr_struct* dst, double op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_nan")]
    private static extern unsafe void set_nan(__mpfr_struct* dst);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_nanflag")]
    public static extern void set_nanflag();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_overflow")]
    public static extern void set_overflow();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_prec")]
    private static extern unsafe void set_prec(__mpfr_struct* dst, uint prec);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_prec_raw")]
    private static extern unsafe void set_prec_raw(__mpfr_struct* dst, uint prec);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_q")]
    private static extern unsafe int set_q(__mpfr_struct* dst, __mpq_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_si")]
    private static extern unsafe int set_si(__mpfr_struct* dst, int op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_si_2exp")]
    private static extern unsafe int set_si_2exp(__mpfr_struct* dst, int op1, int exp, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_str")]
    private static extern unsafe int set_str(__mpfr_struct* dst, byte* cstr, int op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_ui")]
    private static extern unsafe int set_ui(__mpfr_struct* dst, uint op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_ui_2exp")]
    private static extern unsafe int set_ui_2exp(__mpfr_struct* dst, uint op1, int exp, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_underflow")]
    public static extern void set_underflow();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_set_z")]
    private static extern unsafe int set_z(__mpfr_struct* dst, __mpz_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_setsign")]
    private static extern unsafe int setsign(__mpfr_struct* dst, __mpfr_struct* op1, int op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_sgn")]
    private static extern unsafe int sgn(__mpfr_struct* dst);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_si_div")]
    private static extern unsafe int si_div(__mpfr_struct* dst, int op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_si_sub")]
    private static extern unsafe int si_sub(__mpfr_struct* dst, int op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_signbit")]
    private static extern unsafe int signbit(__mpfr_struct* dst);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_sin")]
    private static extern unsafe int sin(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_sin_cos")]
    private static extern unsafe int sin_cos(__mpfr_struct* dst, __mpfr_struct* op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_sinh")]
    private static extern unsafe int sinh(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_sinh_cosh")]
    private static extern unsafe int sinh_cosh(__mpfr_struct* dst, __mpfr_struct* op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_snprintf")]
    private static extern unsafe int snprintf(byte* cstr1, int len, byte* cstr2, __mpfr_struct* t);
    //[DllImport(DLL_PATH, EntryPoint = "mpfr_sprintf")]
    //private static extern unsafe int sprintf(byte* cstr1, byte* cstr2, ...);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_sqr")]
    private static extern unsafe int sqr(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_sqrt")]
    private static extern unsafe int sqrt(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_sqrt_ui")]
    private static extern unsafe int sqrt_ui(__mpfr_struct* dst, uint op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_strtofr")]
    private static extern unsafe int strtofr(__mpfr_struct* dst, byte* cstr1, byte** pcstr2, int op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_sub")]
    private static extern unsafe int sub(__mpfr_struct* dst, __mpfr_struct* op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_sub_d")]
    private static extern unsafe int sub_d(__mpfr_struct* dst, __mpfr_struct* op1, double op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_sub_q")]
    private static extern unsafe int sub_q(__mpfr_struct* dst, __mpfr_struct* op1, __mpq_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_sub_si")]
    private static extern unsafe int sub_si(__mpfr_struct* dst, __mpfr_struct* op1, int op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_sub_ui")]
    private static extern unsafe int sub_ui(__mpfr_struct* dst, __mpfr_struct* op1, uint op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_sub_z")]
    private static extern unsafe int sub_z(__mpfr_struct* dst, __mpfr_struct* op1, __mpz_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_subnormalize")]
    private static extern unsafe int subnormalize(__mpfr_struct* dst, int op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_sum")]
    private static extern unsafe int sum(__mpfr_struct* dst, __mpfr_struct** op1, uint op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_swap")]
    private static extern unsafe void swap(__mpfr_struct* dst, __mpfr_struct* op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_tan")]
    private static extern unsafe int tan(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_tanh")]
    private static extern unsafe int tanh(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_ui_div")]
    private static extern unsafe int ui_div(__mpfr_struct* dst, uint op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_ui_pow")]
    private static extern unsafe int ui_pow(__mpfr_struct* dst, uint op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_ui_pow_ui")]
    private static extern unsafe int ui_pow_ui(__mpfr_struct* dst, uint op1, uint op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_ui_sub")]
    private static extern unsafe int ui_sub(__mpfr_struct* dst, uint op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_underflow_p")]
    public static extern int underflow_p();
    [DllImport(DLL_PATH, EntryPoint = "mpfr_unordered_p")]
    private static extern unsafe int unordered_p(__mpfr_struct* dst, __mpfr_struct* op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_urandomb")]
    private static extern unsafe int urandomb(__mpfr_struct* dst, __gmp_randstate_struct* op1);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_y0")]
    private static extern unsafe int y0(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_y1")]
    private static extern unsafe int y1(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_yn")]
    private static extern unsafe int yn(__mpfr_struct* dst, int op1, __mpfr_struct* op2, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_zero_p")]
    private static extern unsafe int zero_p(__mpfr_struct* dst);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_zeta")]
    private static extern unsafe int zeta(__mpfr_struct* dst, __mpfr_struct* op1, int rnd);
    [DllImport(DLL_PATH, EntryPoint = "mpfr_zeta_ui")]
    private static extern unsafe int zeta_ui(__mpfr_struct* dst, uint op1, int rnd);
    #endregion
  }
}
